package com.bicon.botu.mall.order.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.bicon.botu.core.base.common.Constants;
import com.bicon.botu.mall.order.entity.OrderRecords;
import com.bicon.botu.mall.order.mapper.OrderRecordsMapper;
import com.bicon.botu.mall.order.service.IOrderRecordsService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 李双喜
 * @since 2018-06-27
 */
@Service
public class OrderRecordsServiceImpl extends ServiceImpl<OrderRecordsMapper, OrderRecords> implements IOrderRecordsService {
    /**
     * 分页查询订单记录
     */
    @Override
    public Page<OrderRecords> selectPageRecord(Integer pageNo, Integer pageSize, String orderGoodsId){
        EntityWrapper<OrderRecords> entityWrapper = new EntityWrapper<>();
        entityWrapper.eq("logic_delete", Constants.DEL_LOGIC_NORMAL);
        entityWrapper.eq("order_goods_id",orderGoodsId);
        entityWrapper.orderBy("create_date",false);
        Page<OrderRecords> page = this.selectPage(new Page<>(pageNo,pageSize),entityWrapper);
        return page;
    }
	
}
